package com.youyi.yyfilepickerlibrary.core;

import android.graphics.drawable.Drawable;
import android.os.Environment;
import android.text.TextUtils;
import com.lkx.liandianqinew.R;
import java.io.File;

public class SelectOptions {
    public static final String CHOOSE_TYPE_BROWSER = "choose_type_browser";
    public static final String CHOOSE_TYPE_MEDIA = "choose_type_media";
    public static final String CHOOSE_TYPE_SCAN = "choose_type_scan";
    public static final int REQUEST_CODE_CHOOSE_FILE = 23;
    public static final int REQUEST_CODE_CHOOSE_FOLDER = 24;
    public static final String defaultTargetPath = (Environment.getExternalStorageDirectory() + "/essPictures");
    public boolean compressImage = true;
    public boolean enabledCapture = false;
    public boolean isFolder = false;
    public boolean isSingle = false;
    public String[] mFileTypes;
    public String mSortType;
    public int maxCount = 10;
    public boolean onlyShowImages = false;
    public boolean onlyShowVideos = false;
    public Drawable placeHolder;
    public int request_code;
    public String targetPath = defaultTargetPath;
    public int themeId = com.uuzuche.lib_zxing.R.style.AppTheme;

    public String[] getFileTypes() {
        String[] strArr = this.mFileTypes;
        return (strArr == null || strArr.length == 0) ? new String[0] : strArr;
    }

    public int getSortType() {
        if (TextUtils.isEmpty(this.mSortType)) {
            return 0;
        }
        return Integer.valueOf(this.mSortType).intValue();
    }

    public String getTargetPath() {
        if (new File(this.targetPath).exists()) {
            return this.targetPath;
        }
        String str = defaultTargetPath;
        File file = new File(str);
        if (!file.exists()) {
            file.mkdirs();
        }
        return str;
    }

    public void setSortType(int i) {
        this.mSortType = String.valueOf(i);
    }

    public static SelectOptions getInstance() {
        return InstanceHolder.INSTANCE;
    }

    public static SelectOptions getCleanInstance() {
        SelectOptions instance = getInstance();
        instance.reset();
        return instance;
    }

    private void reset() {
        this.mFileTypes = new String[0];
        this.mSortType = String.valueOf(0);
        this.isSingle = false;
        this.isFolder = false;
        this.maxCount = 10;
        this.onlyShowImages = false;
        this.onlyShowVideos = false;
        this.enabledCapture = false;
        this.compressImage = true;
        this.themeId = com.uuzuche.lib_zxing.R.style.AppTheme;
    }

    /* access modifiers changed from: private */
    public static final class InstanceHolder {
        private static final SelectOptions INSTANCE = new SelectOptions();

        private InstanceHolder() {
        }
    }
}
